# 讨论串贴文
import requests
import json

url = "https://club.bwplus.com.tw/apis/wegrow/v1/post"

headers = {
    'Accept': 'application/json, text/plain, */*',
    'Accept-Language': 'zh-CN,zh;q=0.9',
    'Cache-Control': 'no-cache',
    'Connection': 'keep-alive',
    'Content-Type': 'application/json',
    'Cookie': 'device_id=bw_iweb_1683614727353_6939761572; nuuid=dfcdac03-b04d-4bfa-4ca6-08dbb55165b1; level=1; _gid=GA1.3.73864617.1703466869; token=3a8fdd2c4e654d37adf50895739f5845; BWG_CC=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJERVZJQ0VJRCI6ImRmY2RhYzAzLWIwNGQtNGJmYS00Y2E2LTA4ZGJiNTUxNjViMSIsIk9TIjoiV2ViIiwiVkVSU0lPTiI6IjEyMC4wLjAuMCIsIlNFUlZJQ0VJRCI6IjIiLCJERVNDUklCRSI6IkNocm9tZSIsIkJXUFVTSFRPS0VOIjoiIiwiVUlEIjoiIiwiU1VCU0NSSUJFUklEIjoiIiwiRU1BSUwiOiIiLCJGQUNFQk9PSyI6IiIsIkdPT0dMRSI6IiIsIkxJTkUiOiIiLCJXRUNIQVQiOiIiLCJOQU1FIjoiIiwiTklDSyI6IiIsIlZJUCI6Ii0xIiwiVVNFUlRZUEUiOiIiLCJQSE9UTyI6IiIsIkVYUElSRVRJTUUiOjE3MDQ3ODE4MzUsIkdJVkVOVElNRSI6MTcwMzQ4NTgzNX0.SCw1VkJ-EgTCfkgsHl5HIoMUvyA35Y_tRSdD_jNDvWs; user_id=295785; ssoUserId=1805489; today1=12-28-3a8fdd2c4e654d37adf50895739f5845; isPlusLogin=true; token_expire_time=1706325506000; tct=1703733506477; isOfficial=0; weGrowGroupId=40; isWegrowShare=1; isWegrowHomework=1; toc_usession=8728135255949788%7Cref_aHR0cHM6Ly9id3BsdXMuY29tLnR3L1dlR3Jvdy90aW1lbGluZS5odG1s; _ga_888W9RS06J=GS1.1.1703746946.59.1.1703748967.57.0.0; _gat_gtag_UA_904208_128=1; toc_utk="uv=0139977714683272&&pv=ffa10e0a4fa2144d9110d494f9f3be0a&&utn=1703748982160&&utl=1703748965440&&utc=1701255683274&&pf=357,20"; urlHref=https://club.bwplus.com.tw/#/Timeline/Discussion?postId=46516&articleDetails=%7B%22adminStatus%22%3Afalse%2C%22articleId%22%3A3014322%2C%22articleImg%22%3A%22https%3A%2F%2Fstatic.bwplus.com.tw%2Fclub%2Fimg%2Fdef_img.fbfc7f52.png%22%2C%22articleTitle%22%3A%22%25E5%25BE%259E%25E7%2585%25AE%25E6%25B9%25AF%25E5%259C%2593%25E7%259C%258B%25E8%25A6%258B%25E4%25B8%2580%25E5%2580%258B%25E6%25AF%258D%25E8%25A6%25AA%25E7%25B5%25A6%25E5%25A5%25B3%25E5%2585%2592%25E7%259A%2584%25E4%25BA%25BA%25E7%2594%259F%25E9%25A0%2598%25E6%259C%2583%25EF%25BC%259A%25E5%2588%25A5%25E5%25B0%258F%25E7%259C%258B%25E8%2587%25AA%25E5%25B7%25B1%25EF%25BC%258C%25E5%25BE%2585%25E5%259C%25A8%25E6%25B2%2592%25E6%2588%2590%25E9%2595%25B7%25E7%25A9%25BA%25E9%2596%2593%25E7%259A%2584%25E7%2592%25B0%25E5%25A2%2583%25E8%25A3%25A1%22%2C%22articleType%22%3A1%2C%22articleUrl%22%3A%22https%3A%2F%2Fbwplus.com.tw%2FSpiritgrow%2Farticle%2F1267242166.html%22%2C%22groupId%22%3A40%2C%22groupName%22%3A%22%E6%B8%AC%E8%A9%A6%E4%BC%81%E6%A5%AD%E7%BE%A43%22%2C%22groupOrigin%22%3A0%2C%22postId%22%3A46516%2C%22enterFrom%22%3A%22timeline%22%2C%22userAvatar%22%3A%22https%3A%2F%2Fimgs.bwplus.com.tw%2Favatar%2F1%2F202312%2F28d96d9b-f22e-469e-bf46-5ccf467dda3c.png%22%2C%22userName%22%3A%22%E4%BC%81%E6%A5%AD%E6%AD%A3%E5%BC%8F%20Manger%22%2C%22userId%22%3A1805489%2C%22postOrigin%22%3A0%7D; _gat_UA-904208-128=1; _ga_3XJNE4KS80=GS1.1.1703748989.36.0.1703748989.0.0.0; _ga=GA1.1.1078365725.1701255686',
    'Origin': 'https://club.bwplus.com.tw',
    'Pragma': 'no-cache',
    'Referer': 'https://club.bwplus.com.tw/',
    'Sec-Fetch-Dest': 'empty',
    'Sec-Fetch-Mode': 'cors',
    'Sec-Fetch-Site': 'same-origin',
    'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1',
    'token': '3a8fdd2c4e654d37adf50895739f5845'
}

for i in range(1000):
    payload = json.dumps({
        "postContent": "從煮湯圓看見一個母親給女兒的人生領會" + str(i),
        "articleType": 1,
        "articleId": 3014322,
        "articleTitle": "從煮湯圓看見一個母親給女兒的人生領會：別小看自己，待在沒成長空間的環境裡",
        "articleUrl": "https://bwplus.com.tw/Spiritgrow/article/1267242166.html",
        "articleImg": "https://static.bwplus.com.tw/club/img/def_img.fbfc7f52.png",
        "postType": 0,
        "weGrowGroupId": [
            40
        ],
        "targetSsoUserId": [],
        "groupOrigin": 0
    })
    response = requests.request("POST", url, headers=headers, data=payload)
    print(response.text)
